<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Dashboard</title>
<!-- Mobile specific metas -->
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- Force IE9 to render in normal mode -->
<!--[if IE]><meta http-equiv="x-ua-compatible" content="IE=9" /><![endif]-->
<meta name="author" content="SuggeElson" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="application-name" content="sprFlat admin template" />
<!-- Import google fonts - Heading first/ text second -->
<link rel='stylesheet' type='text/css' />
<!--[if lt IE 9]>

    <![endif]-->
<!-- Css files -->
<!-- Icons -->
<link href="../../../assets/css/icons.css"
	rel="stylesheet" />
<!-- jQueryUI -->
<link
	href="../../../assets/css/sprflat-theme/jquery.ui.all.css"
	rel="stylesheet" />
<!-- Bootstrap stylesheets (included template modifications) -->
<link href="../../../assets/css/bootstrap.css"
	rel="stylesheet" />
<!-- Plugins stylesheets (all plugin custom css) -->
<link href="../../../assets/css/plugins.css"
	rel="stylesheet" />
<!-- Main stylesheets (template main css file) -->
<link href="../../../assets/css/main.css"
	rel="stylesheet" />
<!-- Custom stylesheets ( Put your own changes here ) -->
<link href="../../../assets/css/custom.css"
	rel="stylesheet" />
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144"
	href="../../../assets/img/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114"
	href="../../../assets/img/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72"
	href="../../../assets/img/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed"
	href="../../../assets/img/ico/apple-touch-icon-57-precomposed.png">
<link rel="icon"
	href="../../../assets/img/ico/favicon.ico"
	type="image/png">
<!-- Windows8 touch icon ( http://www.buildmypinnedsite.com/ )-->
<meta name="msapplication-TileColor" content="#3399cc" />
</head>
<body>
	<!-- Start #header -->
	<div id="header">
		<div class="container-fluid">
			<div class="navbar">
				<div class="navbar-header">
					<a class="navbar-brand" href="index.html"> <i
						class="im-windows8 text-logo-element animated bounceIn"></i><span
						class="text-logo">spr</span><span class="text-slogan">flat</span>
					</a>
				</div>
				<nav class="top-nav" role="navigation">
					<ul class="nav navbar-nav pull-left">
						<li id="toggle-sidebar-li"><a href="#" id="toggle-sidebar"><i
								class="en-arrow-left2"></i> </a></li>
						<li><a href="#" class="full-screen"><i
								class="fa-fullscreen"></i></a></li>


					</ul>

				</nav>
			</div>
			<!-- Start #header-area -->
			<div id="header-area" class="fadeInDown">
				<div class="header-area-inner">
					<ul class="list-unstyled list-inline">
						<li>
							<div class="shortcut-button">
								<a href="#"> <i class="im-pie"></i> <span>Earning
										Stats</span>
								</a>
							</div>
						</li>
						<li>
							<div class="shortcut-button">
								<a href="#"> <i class="ec-images color-dark"></i> <span>Gallery</span>
								</a>
							</div>
						</li>
						<li>
							<div class="shortcut-button">
								<a href="#"> <i class="en-light-bulb color-orange"></i> <span>Fresh
										ideas</span>
								</a>
							</div>
						</li>
						<li>
							<div class="shortcut-button">
								<a href="#"> <i class="ec-link color-blue"></i> <span>Links</span>
								</a>
							</div>
						</li>
						<li>
							<div class="shortcut-button">
								<a href="#"> <i class="ec-support color-red"></i> <span>Support</span>
								</a>
							</div>
						</li>
						<li>
							<div class="shortcut-button">
								<a href="#"> <i class="st-lock color-teal"></i> <span>Lock
										area</span>
								</a>
							</div>
						</li>
					</ul>
				</div>
			</div>
			<!-- End #header-area -->
		</div>
		<!-- Start .header-inner -->
	</div>
	<!-- End #header -->
	<!-- Start #sidebar -->
	<div id="sidebar">
		<!-- Start .sidebar-inner -->
		<div class="sidebar-inner">
			<!-- Start #sideNav -->
			<ul id="sideNav" class="nav nav-pills nav-stacked">
				<li class="top-search">
					<form>
						<input type="text" name="search" placeholder="Search ...">
						<button type="submit"><i class="ec-search s20"></i>
						</button>
					</form>
				</li>
				<!--  <li><a href="../index.html">我的空间 <i class="im-screen"></i></a>

                  </li>

                  <li><a href="#">我的身份信息 <i class="ec-user"></i></a>
                  </li>-->

				<li><a href="../index.html">我的空间 <i class="im-screen"></i></a>

				</li>

				<li><a href="../person/personShow.html">我的身份信息 <i class="ec-user"></i></a>
				</li>

				<li><a href="#">公告管理 <i class="im-home2"></i></a>
					<ul class="nav sub">
						<li><a href="../notice/noticeManger.html"><i class="im-pencil2"></i> 管理公告</a>
						</li>
						<li><a href="../notice/noticeIssue.html"><i class="im-warning"></i> 发布公告</a>
						</li>
					</ul>
				</li>


				<li><a href="#">学生信息管理 <i class="ec-pencil"></i></a>
					<ul class="nav sub">
						<li><a href="../studentManagement/studentRegister.html"><i class="im-pencil2"></i> 学生注册</a>
						</li>
						<li><a href="../studentManagement/studentDelete.html"><i class="im-pencil2"></i> 学生删除</a>
						</li>
					</ul>
				</li>

				<li><a href="#">成绩管理 <i class="ec-pencil"></i></a>
					<ul class="nav sub">
						<li><a href="../mark/MarkManger.html"><i class="im-pencil2"></i> 成绩查询</a>
						</li>

						<li><a href="../mark/FrontPageAddUpdateMark.html"><i class="im-warning"></i> 成绩管理</a>
						</li>
						<li><a href="../mark/WarningManger.html"><i class="im-warning"></i> 学业警示管理</a>
						</li>
					</ul>
				</li>

				<li><a href="#">社会实践管理 <i class="ec-star"></i></a>
					<ul class="nav sub">

						<li><a href="../project/mangerProject.html"><i class="im-pencil2"></i> 项目管理</a>
						</li>
					</ul>
				</li>


				<li><a href="#">党建管理 <i class="ec-users"></i></a>
					<ul class="nav sub">
						<li><a href="../partyActivity/partyActivity.html"><i class="im-pencil2"></i> 党支部活动</a></li>
						<li><a href="../partyActivity/partyActivityAdd.html"><i class="im-pencil2"></i> 党支部活动添加</a></li>
						<li><a href="../partyApply/partyapplyHandle.html"><i class="im-pencil2"></i> 入党申请管理</a></li>
						<li><a href="../partyMember/partyMember.html"><i class="im-pencil2"></i> 党员信息管理</a></li>
					</ul>
				</li>


			</ul>

		</div>
		<!-- End .sidebar-inner -->
	</div>
	<!-- End #sidebar -->

	<!-- Start #content -->
	<div id="content">
		<!-- Start .content-wrapper -->
		<div class="content-wrapper">
			<div class="row">
				<!-- Start .row -->
				<!-- Start .page-header -->
				<div class="col-lg-12 heading">
					<h1 class="page-header">
						<i class="im-pencil2"></i> 我的社会实践
					</h1>
					<!-- Start .bredcrumb -->

					<!-- End .breadcrumb -->
				</div>
				<!-- End .page-header -->
			</div>
			<div class="outlet">
				<!-- Start .outlet -->
				<!-- Page start here ( usual with .row ) -->
				<div class="row">

					<div class="col-lg-12">
						<!-- col-lg-12 start here -->
						<div
							class="panel panel-default plain toggle panelClose panelRefresh">
							<!-- Start .panel -->
							<div class="panel-heading white-bg">
								<h4 class="panel-title">社会实践申请列表</h4>
							</div>
							<div class="panel-body">
								<table class="table display" id="">
									<thead>
										<tr>
											<th>项目编号</th>
											<th>学号</th>
											<th>姓名</th>
											<th>性别</th>
											<th>学院</th>
											<th>学年</th>
											<th>学期</th>
											<th>项目名称</th>
											<th>项目内容</th>
											<th>开始时间</th>
											<th>结束时间</th>
											<th>联系人</th>
											<th>联系电话</th>
											<th>使用平台</th>
											<th>申请状态</th>
											<th>操作</th>
										</tr>
									</thead>
									<tbody id="tbody">

									</tbody>
								</table>
							</div>
						</div>
						<!-- End .panel -->
					</div>
					<!-- col-lg-12 end here -->
				</div>
				<!-- End .row -->
			</div>
			<!-- End .outlet -->
		</div>
	</div>
	<!-- End .content-wrapper -->
	<div class="clearfix"></div>
	</div>
	<!-- End #content -->
	<!-- Javascripts -->
	<!-- Load pace first -->
	<script
		src="../../../assets/plugins/core/pace/pace.min.js"></script>
	<!-- Important javascript libs(put in all pages) -->
	<script
		src="../../../assets/js/jquery-1.8.3.min.js"></script>
	<script>
    window.jQuery || document.write('<script src="../../../assets/js/libs/jquery-2.1.1.min.js">\x3C/script>')
</script>
	<script src="../../../assets/js/jquery-ui.js"></script>
	<script>
    window.jQuery || document.write('<script src="../../../assets/js/libs/jquery-ui-1.10.4.min.js">\x3C/script>')
</script>
	<!--[if lt IE 9]>
<script type="text/javascript" src="../../../assets/js/libs/excanvas.min.js"></script>
<script type="text/javascript" src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<script type="text/javascript" src="../../../assets/js/libs/respond.min.js"></script>
<![endif]-->
	<script
		src="../../../assets/js/bootstrap/bootstrap.js"></script>
	<!-- Core plugins ( not remove ever) -->
	<!-- Handle responsive view functions -->
	<script
		src="../../../assets/js/jRespond.min.js"></script>
	<!-- Custom scroll for sidebars,tables and etc. -->
	<script
		src="../../../assets/plugins/core/slimscroll/jquery.slimscroll.min.js"></script>
	<script
		src="../../../assets/plugins/core/slimscroll/jquery.slimscroll.horizontal.min.js"></script>
	<!-- Resize text area in most pages -->
	<script
		src="../../../assets/plugins/forms/autosize/jquery.autosize.js"></script>
	<!-- Proivde quick search for many widgets -->
	<script
		src="../../../assets/plugins/core/quicksearch/jquery.quicksearch.js"></script>
	<!-- Bootbox confirm dialog for reset postion on panels -->
	<script
		src="../../../assets/plugins/ui/bootbox/bootbox.js"></script>
	<!-- Other plugins ( load only nessesary plugins for every page) -->
	<script
		src="../../../assets/plugins/core/moment/moment.min.js"></script>
	<script
		src="../../../assets/plugins/charts/sparklines/jquery.sparkline.js"></script>
	<script
		src="../../../assets/plugins/charts/pie-chart/jquery.easy-pie-chart.js"></script>
	<script
		src="../../../assets/plugins/forms/icheck/jquery.icheck.js"></script>
	<script
		src="../../../assets/plugins/forms/tags/jquery.tagsinput.min.js"></script>
	<script
		src="../../../assets/plugins/forms/tinymce/tinymce.min.js"></script>
	<script
		src="../../../assets/plugins/tables/datatables/jquery.dataTables.min.js"></script>
	<script
		src="../../../assets/plugins/tables/datatables/jquery.dataTablesBS3.js"></script>
	<script
		src="../../../assets/plugins/tables/datatables/tabletools/ZeroClipboard.js"></script>
	<script
		src="../../../assets/plugins/tables/datatables/tabletools/TableTools.js"></script>
	<script
		src="../../../assets/plugins/misc/highlight/highlight.pack.js"></script>
	<script
		src="../../../assets/plugins/misc/countTo/jquery.countTo.js"></script>
	<script
		src="../../../assets/js/jquery.sprFlat.js"></script>
	<script src="../../../assets/js/app.js"></script>
	<script
		src="../../../assets/js/pages/data-tables.js"></script>
	<script
		src="../../../myjs/admin/project/mangerproject.js"></script>
	<script src="../../../assets/js/layer.js"></script>
	<script type="text/javascript">
	$(function(){
		loadAllProject();
		$("#sheHuiShiJianGuanLi").click(function() {
			loadAllProject();
		})
		function loadAllProject(){
			$.ajax({
				url : "http://localhost:8080/student/findAllStuProject",
				type : "post",
				data : {},
				dataType : "json",
				success : function(results) {
					for(var i in results){
						var tr = $("<tr><td class='project_id'>"+results[i].projectId+"</td><td class='stu_num'>"+results[i].stuNum+"</td><td class='stu_name'>"+results[i].stuName+"</td><td class='stu_SexName'>"+results[i].stuSexName+"</td><td class='academy_name'>"+results[i].academyName+"</td><td class='stu_grade'>"+results[i].stuGrade+"</td><td class='term_num'>"+results[i].termNum+"</td><td class='project_name'>"+results[i].projectName+"</td><td class='project_content'>"+results[i].projectContent+"</td><td class='project_start_date'>"+results[i].projectStartDate+"</td><td class='project_endt_date'>"+results[i].projectEndtDate+"</td><td class='project_contact_people'>"+results[i].projectContactPeople+"</td><td class='project_phonenum'>"+results[i].projectPhonenum+"</td><td class='project_platform'>"+results[i].projectPlatform+"</td>")
						if(results[i].projectState==1){
                            tr.append("<td class='projectStateName'>待审核</td><td><button class='agree btn btn-success'>同意</button>&nbsp;<button class='reject btn btn-warning'>拒绝</button></td></tr>")
						}else if(results[i].projectState==4){
                            tr.append("<td class='projectStateName'>结项待批准</td><td><button class='pizhun btn btn-success'>批准</button>&nbsp;<button class='jujue btn btn-warning'>拒绝</button></td></tr>")
						}else if(results[i].projectState==2){
                            tr.append("<td class='projectStateName'>立项被拒绝</td><td></td></tr>")
                        }else if(results[i].projectState==3){
                            tr.append("<td class='projectStateName'>立项通过</td><td></td></tr>")
                        }else if(results[i].projectState==5){
                            tr.append("<td class='projectStateName'>结项被拒绝</td><td></td></tr>")
                        }else if(results[i].projectState==6){
                            tr.append("<td class='projectStateName'>已结项</td><td></td></tr>")
                        }

						$("tbody").append(tr);

					}

                    $(".agree").click(function(){
                        var project_id = $(this).parents("tr").children().eq(0).text();
                        $.ajax({
                            url:"http://localhost:8080/teacher/switchState",
                            type:"post",
                            data:{"project_id":project_id,"project_state":3},
                            dataType:"text",
                            success:function(result){
                                if(result=="true"){
                                    alert("已同意")
                                    //删除成功 重新加载
                                    window.location.reload()
                                }else{
                                    alert("同意失败")
                                }
                            },
                            error:function(){
                                alert("请求错误")
                            }
                        })
                    })

                    $(".reject").click(function(){
                        var project_id = $(this).parents("tr").children().eq(0).text()
                        $.ajax({
                            url:"http://localhost:8080/teacher/switchState",
                            type:"post",
                            data:{"project_id":project_id,"project_state":2},
                            dataType:"text",
                            success:function(result){
                                if(result=="true"){
                                    alert("已拒绝")
                                    //删除成功 重新加载
                                    window.location.reload()
                                }else{
                                    alert("拒绝失败")
                                }
                            },
                            error:function(){
                                alert("请求错误")
                            }
                        })
                    })

                    $(".pizhun").click(function(){
                        var project_id = $(this).parents("tr").children().eq(0).text()
                        $.ajax({
                            url:"http://localhost:8080/teacher/switchState",
                            type:"post",
                            data:{"project_id":project_id,"project_state":6},
                            dataType:"text",
                            success:function(result){
                                if(result=="true"){
                                    alert("已批准")
                                    //删除成功 重新加载
                                    window.location.reload()
                                }else{
                                    alert("批准失败")
                                }
                            },
                            error:function(){
                                alert("请求错误")
                            }
                        })
                    })

                    $(".jujue").click(function(){
                        var project_id = $(this).parents("tr").children().eq(0).text()
                        $.ajax({
                            url:"http://localhost:8080/teacher/switchState",
                            type:"post",
                            data:{"project_id":project_id,"project_state":5},
                            dataType:"text",
                            success:function(result){
                                if(result=="true"){
                                    alert("已拒绝")
                                    //删除成功 重新加载
                                    window.location.reload()
                                }else{
                                    alert("拒绝失败")
                                }
                            },
                            error:function(){
                                alert("请求错误")
                            }
                        })
                    })



				},
				error : function() {
					alert("请求有误");
				}
			})
		}
	})
</script>
</body>
</html>